package com.example.transation.txlcnprovider.controller;

import com.example.transation.txlcncommon.bean.Result;
import com.example.transation.txlcncommon.bean.entity.ProviderEntity;
import com.example.transation.txlcnprovider.server.ProviderService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * 支持服务Controller
 *
 * @author luojm
 * 2020-08-31 11:05:10
 */

@RestController
@AllArgsConstructor
@RequestMapping(value = "/provider")
public class ProviderController{

  private final ProviderService providerService;

    @GetMapping("/hello" )
    public String hello() {
        return "provider 成功了！";
    }

    @GetMapping("txlcn/save")
    public Result<ProviderEntity> txlcnSave(@RequestParam("name") String name){
        return providerService.saveTxlcn(name);
    }

}
